﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain
{
    /// <summary>
    /// 深加工信息类
    /// </summary>
    public class DeepProcessingInfo : AuditableEntity
    {
        private static int _currentIdNumber = 1;

        /// <summary>
        /// 深加工编号（格式H001，自增）
        /// </summary>
        [Key]
        public string ProcessingId { get; private set; }

        /// <summary>
        /// 加工班组（不为空）
        /// </summary>
        public string TeamGroup { get; set; }

        /// <summary>
        /// 负责人（不为空）
        /// </summary>
        public string Supervisor { get; set; }

        /// <summary>
        /// 关联的生产批次（外键）
        /// </summary>
        public string ProductionBatch { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public DeepProcessingInfo()
        {
            ProcessingId = $"H{_currentIdNumber.ToString().PadLeft(3, '0')}";
            _currentIdNumber++;
        }
    }
}
